package com.yanfan.energy.mapper;

import com.yanfan.energy.domain.*;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 批次管理 dao层相关
 */
@Repository
public interface BatchesDao {
    /**
     * 批次管理 List列表
     *
     * @param request
     * @return
     */
    List<Batches> batchesList(BatchesRequest request);

    int addBatches(BatchesRequest request);

    int updateBatches(BatchesRequest request);

    Batches batchesDetail(BatchesRequest request);

    int deleteBatches(BatchesRequest request);

    List<BatchesInfo> batchesSummarizing();

    List<BatchesInfo> batchesFinishedRate(@Param("endDateArr") List<String> endDateArr);

    int batchesListCount();

    List<FactoryVo> queryPlants();

    List<WorkshopVo> queryWorkshops();

    List<WorkshopVo> queryWorkshopListByFactory(Integer plantId);

    @MapKey("id")
    Map<Long, Map<String, String>> queryFactoryMap();

    @MapKey("id")
    Map<Long, Map<String, String>> queryWorkshopMap();
}
